<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Administrator Home</title>
<link href="css/default.css" rel="stylesheet" type="text/css" />
<script language="JavaScript" src="scripts/rand_password.js"></script>
<?php include('includes/path.php'); ?>

</head>

<body class="oneColFixCtrHdr">
    <script>
        <!--
        function Blank_TextField_Validator() {
            // Check the value of the element named text_name from the form named text_form
            if (login.Login.value == "") {
                // If null display and alert box
                alert("Email field is blank!");
                // Place the cursor on the field for revision
                login.Login.focus();
                // return false to stop further processing
                return (false);
            }
            // If text_name is not null continue processing
            return (true);
        }
        -->
    </script>
<div id="container">
<?php include( 'includes/header.php' ); ?>
<?php include( 'includes/menu.php' ); ?>

  <div id="mainContent">
     <?php
	// This file inserts the following
	// variables: USER, PASS, DB
	include('db.php');

    ?>
    
 <?php
	$HOST = "dbdev.cs.uiowa.edu";
        $TABLE = "New_Accounts";
        $ROW_NUMBER = 0;

        $CON = mysql_connect( $HOST, $USER, $PASS );

        if (!$CON)
          {
                  die('Could not connect: ' . mysql_error());
          }

        mysql_select_db( $DB );
        $QRY = 'SELECT * FROM ' . $TABLE;
	echo '<table style="width: 100%; border: 5px #aba groove;">';
        echo '<tr style="background-color: #77C48E;"><th colspan=4>New Account Requests</th></tr>';
        echo '<tr style="background-color: #D6B376;"><th style="text-align: center; width:50px;">Del</th><th style="text-align: center; width: 500px;">Email</th><th style="text-align: center;">Password</th><th style="text-align: center;">Confirm Password</th></tr>';
        $RESULT = mysql_query($QRY);
	while($ROW = mysql_fetch_array($RESULT))
        {
                echo '<tr style="background-color: #';
                if ( $ROW_NUMBER % 2 ){ echo 'FFF;"'; }
                else { echo 'DEDEDE;"'; }
                echo '><td><input type="checkbox" /></td><td>' . $ROW['email'] . '</td><td style="text-align: right;"><input name="password" type="text" /><td style="text-align: right;"><input name="confirm" type="text" /></td></tr>';
        $ROW_NUMBER++;
        }
        mysql_close($CON);
        echo '<tr><td  style="height:25px;"></td></tr>';
        echo '<tr style="background-color: #55A26C;"><th colspan=4>Account Password Change Requests</th></tr>';
        echo '<tr style="background-color: #D6B376;"><th style="text-align: center; width:50px;">Del</th><th style="text-align: center; width: 500px;">Email</th><th style="text-align: center;">Password</th><th style="text-align: center;">Confirm Password</th></tr>';
        echo '<tr><td style="text-align: right;"></td><td style="text-align: right;"><input type="button" onClick="passLabel.value = randPass()" value="Create Random Password"><input type="text" id="passLabel" name="passLabel" /></td><td style="text-align: right;"><input type="button" value="Approve"></td></tr>';
        echo '</table>';
    
?>
  <!-- end #mainContent --></div>
<?php include('includes/footer.php'); ?>
<!-- end #container --></div>
</body>
</html>
